local wusheng = fk.CreateSkill{
  name = "klmou__wusheng",
}

Fk:loadTranslationTable{
  ["klmou__wusheng"] = "武圣",
  [":klmou__wusheng"] = "你可以将一张牌当【杀】使用或打出。出牌阶段时，你使用点数为英文的黑色【杀】不计入次数限制，你使用的点数为数字的红色【杀】伤害+1（转化牌使用转化前的点数和花色）。",

  ["#klmou__wusheng"] = "武圣：你可以将一张牌当【杀】使用或打出",

  ["$klmou__wusheng1"] = "尔辈奸邪祸国，岂知人神共忿！",
  ["$klmou__wusheng2"] = "佐汉杀贼沥肝胆，赤心换得日月明！",
}

wusheng:addEffect("viewas", {
  pattern = "slash",
  anim_type = "offensive",
  prompt = "#klmou__wusheng",
  handly_pile = true,
  filter_pattern = {
    min_num = 1,
    max_num = 1,
    pattern = ".",
  },
  interaction = function(self, player)
    local all_names = table.filter(Fk:getAllCardNames("b"), function(name)
      return Fk:cloneCard(name).trueName == "slash"
    end)
    local names = player:getViewAsCardNames(wusheng.name, all_names)
    return UI.CardNameBox { choices = names, all_choices = all_names }
  end,
  view_as = function(self, player, cards)
    if self.interaction.data == nil or #cards ~= 1 then return end
    local card = Fk:cloneCard(self.interaction.data)
    card.skillName = wusheng.name
    card:addSubcards(cards)
    return card
  end,
})

wusheng:addEffect(fk.PreCardUse, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(wusheng.name) and data.card and data.card:matchPattern("slash|2~10|heart,diamond")
  end,
  on_cost = Util.TrueFunc,
  on_use = function (self, event, target, player, data)
    data.additionalDamage = (data.additionalDamage or 0) + 1
  end,
})

wusheng:addEffect(fk.PreCardUse, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(wusheng.name) and data.card and data.card:matchVSPattern("slash|1,11,12,13|club,spade")
  end,
  on_cost = Util.TrueFunc,
  on_use = function (self, event, target, player, data)
    data.extraUse = true
  end,
})

wusheng:addEffect("targetmod", {
  bypass_times = function (self, player, skill, scope, card, to)
    return player:hasSkill(wusheng.name) and player.phase == Player.Play and card and card:matchVSPattern("slash|1,11,12,13|club,spade")
  end,
})


return wusheng
